package com.karaoke.oksrv.controller

import com.karaoke.oksrv.domain.RoomInfo
import com.karaoke.oksrv.domain.Song
import com.karaoke.oksrv.service.RoomService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestMethod
import org.springframework.web.bind.annotation.RestController

/**
 * Created by Administrator on 2017/4/12.
 */
@RestController
@RequestMapping("/api/v1/room")
class RoomController
{
    @RequestMapping(value = "/info/{roomId}", method = arrayOf(RequestMethod.GET))
    fun getRoomInfo(@PathVariable roomId: String): RoomInfo
    {
        return roomService.getRoomInfo(roomId)
    }


    @RequestMapping(value = "/publicSongs", method = arrayOf(RequestMethod.GET))
    fun getPublicSongs() = roomService.getPublicSongs()


    @RequestMapping(value = "scrollTexts", method = arrayOf(RequestMethod.GET))
    fun getScrollTexts() = roomService.getScrollTexts()



    @Autowired lateinit var roomService: RoomService
}
